-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backend [Integration Test] bounty.go handlers GetPersonCreatedBounties, GetPersonAssignedBounties, & GetBountyByCreated #1544
Backend [Integration Test] bounty.go handlers GetPersonCreatedBounties, GetPersonAssignedBounties, & GetBountyByCreated #1544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for the most part this PR is good, would be better if we were asserting the exact response but we're already mocking the db so not sure how good of a test that would be.
I need to double check that we're testing the failure scenarios since those are important aswell
assert.NotEmpty(t, responseData) | ||
assert.Len(t, responseData, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just notice that we're not asserting the exact response but just the length and that we have a value coming back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevkevinpal Added additional assertions to validate the exact response.
assert.NotEmpty(t, responseData) | ||
assert.Len(t, responseData, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noticed that we dont assert the exact value here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevkevinpal Added additional assertions to validate the response
assert.NotEmpty(t, responseData) | ||
assert.Len(t, responseData, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with just then lenght and a value being passed back
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevkevinpal Added additional assertions to validate the response
assert.Empty(t, responseData) | ||
assert.Len(t, responseData, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with this assertion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is not need as the response data is already empty
Paid 200k sats! https://community.sphinx.chat/bounty/1479 |
…tBountyByCreated
Describe your changes
Added Unit test for bounty handler to test GetPersonCreatedBounties, GetPersonAssignedBounties and GetBountyByCreated methods
Issue ticket number and link
Closes #1509
Type of change
Please delete options that are not relevant.
Checklist before requesting a review